using HKB.Common;
using System;
using System.Text;
namespace HKB.Web
{
	public class ProductTry
	{
		private Conn conn = new Conn();
		private int _TryID;
		private string _ProductName;
		private string _BuyOnlineAddress;
		private int _SalerID;
		private int _ShopID;
		private int _ClassID;
		private string _ProductPlace;
		private string _ProductImagePath;
		private string _ConsignmentType;
		private int _ProductNum;
		private int _Hits;
		private decimal _marketPrice;
		private decimal _DiscountPrice;
		private decimal _Postage;
		private DateTime _CreateTime;
		private DateTime _BeginDate;
		private DateTime _EndDate;
		private string _ProductIntroduction;
		public int TryID
		{
			get
			{
				return this._TryID;
			}
			set
			{
				this._TryID = value;
			}
		}
		public string ProductName
		{
			get
			{
				return this._ProductName;
			}
			set
			{
				this._ProductName = value;
			}
		}
		public string BuyOnlineAddress
		{
			get
			{
				return this._BuyOnlineAddress;
			}
			set
			{
				this._BuyOnlineAddress = value;
			}
		}
		public int SalerID
		{
			get
			{
				return this._SalerID;
			}
			set
			{
				this._SalerID = value;
			}
		}
		public int ShopID
		{
			get
			{
				return this._ShopID;
			}
			set
			{
				this._ShopID = value;
			}
		}
		public int ClassID
		{
			get
			{
				return this._ClassID;
			}
			set
			{
				this._ClassID = value;
			}
		}
		public string ProductPlace
		{
			get
			{
				return this._ProductPlace;
			}
			set
			{
				this._ProductPlace = value;
			}
		}
		public string ProductImagePath
		{
			get
			{
				return this._ProductImagePath;
			}
			set
			{
				this._ProductImagePath = value;
			}
		}
		public string ConsignmentType
		{
			get
			{
				return this._ConsignmentType;
			}
			set
			{
				this._ConsignmentType = value;
			}
		}
		public int ProductNum
		{
			get
			{
				return this._ProductNum;
			}
			set
			{
				this._ProductNum = value;
			}
		}
		public int Hits
		{
			get
			{
				return this._Hits;
			}
			set
			{
				this._Hits = value;
			}
		}
		public decimal marketPrice
		{
			get
			{
				return this._marketPrice;
			}
			set
			{
				this._marketPrice = value;
			}
		}
		public decimal DiscountPrice
		{
			get
			{
				return this._DiscountPrice;
			}
			set
			{
				this._DiscountPrice = value;
			}
		}
		public decimal Postage
		{
			get
			{
				return this._Postage;
			}
			set
			{
				this._Postage = value;
			}
		}
		public DateTime CreateTime
		{
			get
			{
				return this._CreateTime;
			}
			set
			{
				this._CreateTime = value;
			}
		}
		public DateTime BeginDate
		{
			get
			{
				return this._BeginDate;
			}
			set
			{
				this._BeginDate = value;
			}
		}
		public DateTime EndDate
		{
			get
			{
				return this._EndDate;
			}
			set
			{
				this._EndDate = value;
			}
		}
		public string ProductIntroduction
		{
			get
			{
				return this._ProductIntroduction;
			}
			set
			{
				this._ProductIntroduction = value;
			}
		}
		public int AddProductTry(string ParProductName, string ParBuyOnline, int ParSalerID, int ParShopID, int ParClassID, string ParPlace, string ParImagePath, string ParConsignmentType, int ParProductNum, int ParHits, decimal ParmarketPrice, decimal ParDiscountPrice, decimal ParPostage, DateTime ParCreateTime, DateTime ParBeginDate, DateTime ParEndDate, string ParProductIntroduction)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("insert into HLShop_TryProduct([ProductName],[BuyOnlineAddress],[SalerID],[ShopID],[ClassID],[ProductPlace],[ProductImagePath],[ConsignmentType],");
			stringBuilder.Append("[ProductNum],[Hits],[marketPrice],[DiscountPrice],[Postage],[CreateTime],[BeginDate],[EndDate],[ProductIntroduction]) values(");
			stringBuilder.Append(string.Concat(new object[]
			{
				"'",
				ParProductName,
				"','",
				ParBuyOnline,
				"',",
				ParSalerID,
				",",
				ParShopID,
				",",
				ParClassID,
				",'",
				ParPlace,
				"','",
				ParImagePath,
				"','",
				ParConsignmentType,
				"',",
				ParProductNum,
				","
			}));
			stringBuilder.Append(string.Concat(new object[]
			{
				ParHits,
				",",
				ParmarketPrice,
				",",
				ParDiscountPrice,
				",",
				ParPostage,
				",'",
				ParCreateTime,
				"','",
				ParBeginDate,
				"','",
				ParEndDate,
				"','",
				ParProductIntroduction,
				"')"
			}));
			int result;
			try
			{
				result = this.conn.Execute(stringBuilder.ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[0]);
				result = 0;
			}
			return result;
		}
		public int UpdateProductTry(int ParTryID, string ParProductName, int ParClassID, string ParPlace, string ParImagePath, string ParConsignmentType, int ParProductNum, decimal ParmarketPrice, decimal ParDiscountPrice, decimal ParPostage, DateTime ParBeginDate, DateTime ParEndDate, string ParProductIntroduction)
		{
			int result = 0;
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(string.Concat(new object[]
			{
				"Update HLShop_TryProduct set ProductName='",
				ParProductName,
				"',ClassID=",
				ParClassID,
				",ProductPlace='",
				ParPlace,
				"',ProductImagePath='",
				ParImagePath,
				"'"
			}));
			stringBuilder.Append(string.Concat(new object[]
			{
				",ConsignmentType='",
				ParConsignmentType,
				"',ProductNum=",
				ParProductNum,
				",marketPrice=",
				ParmarketPrice,
				",DiscountPrice=",
				ParDiscountPrice
			}));
			stringBuilder.Append(string.Concat(new object[]
			{
				",Postage=",
				ParPostage,
				",BeginDate='",
				ParBeginDate,
				"',EndDate='",
				ParEndDate,
				"',ProductIntroduction='",
				ParProductIntroduction,
				"' where TryID=",
				ParTryID
			}));
			try
			{
				result = this.conn.Execute(stringBuilder.ToString());
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[0]);
				result = 0;
			}
			return result;
		}
	}
}
